/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package MODEL;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Collection;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author ahmed
 */
@Entity
@Table(name = "PROSPECT")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Prospect.findAll", query = "SELECT p FROM Prospect p"),
    @NamedQuery(name = "Prospect.findByNumTel", query = "SELECT p FROM Prospect p WHERE p.numTel = :numTel"),
    @NamedQuery(name = "Prospect.findByIdPro", query = "SELECT p FROM Prospect p WHERE p.idPro = :idPro"),
    @NamedQuery(name = "Prospect.findByLogin", query = "SELECT p FROM Prospect p WHERE p.login = :login"),
    @NamedQuery(name = "Prospect.findByPassWord", query = "SELECT p FROM Prospect p WHERE p.passWord = :passWord"),
    @NamedQuery(name = "Prospect.findByNomP", query = "SELECT p FROM Prospect p WHERE p.nomP = :nomP"),
    @NamedQuery(name = "Prospect.findByAdresseP", query = "SELECT p FROM Prospect p WHERE p.adresseP = :adresseP"),
    @NamedQuery(name = "Prospect.findByPrenomP", query = "SELECT p FROM Prospect p WHERE p.prenomP = :prenomP")})
public class Prospect implements Serializable {
    private static final long serialVersionUID = 1L;
    @Basic(optional = false)
    @Column(name = "NUM_TEL")
    private int numTel;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @Column(name = "ID_PRO")
    @GeneratedValue(strategy= GenerationType.AUTO)
    private BigDecimal idPro;
    @Basic(optional = false)
    @Column(name = "LOGIN")
    private String login;
    @Basic(optional = false)
    @Column(name = "PASS_WORD")
    private String passWord;
    @Basic(optional = false)
    @Column(name = "NOM_P")
    private String nomP;
    @Basic(optional = false)
    @Column(name = "ADRESSE_P")
    private String adresseP;
    @Basic(optional = false)
    @Column(name = "PRENOM_P")
    private String prenomP;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "prospect")
    private Collection<Reserver> reserverCollection;

    public Prospect() {
    }

    public Prospect(BigDecimal idPro) {
        this.idPro = idPro;
    }

    public Prospect(BigDecimal idPro, int numTel, String login, String passWord, String nomP, String adresseP, String prenomP) {
        this.idPro = idPro;
        this.numTel = numTel;
        this.login = login;
        this.passWord = passWord;
        this.nomP = nomP;
        this.adresseP = adresseP;
        this.prenomP = prenomP;
    }

    public int getNumTel() {
        return numTel;
    }

    public void setNumTel(int numTel) {
        this.numTel = numTel;
    }

    public BigDecimal getIdPro() {
        return idPro;
    }

    public void setIdPro(BigDecimal idPro) {
        this.idPro = idPro;
    }

    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getPassWord() {
        return passWord;
    }

    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }

    public String getNomP() {
        return nomP;
    }

    public void setNomP(String nomP) {
        this.nomP = nomP;
    }

    public String getAdresseP() {
        return adresseP;
    }

    public void setAdresseP(String adresseP) {
        this.adresseP = adresseP;
    }

    public String getPrenomP() {
        return prenomP;
    }

    public void setPrenomP(String prenomP) {
        this.prenomP = prenomP;
    }

    @XmlTransient
    public Collection<Reserver> getReserverCollection() {
        return reserverCollection;
    }

    public void setReserverCollection(Collection<Reserver> reserverCollection) {
        this.reserverCollection = reserverCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPro != null ? idPro.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Prospect)) {
            return false;
        }
        Prospect other = (Prospect) object;
        if ((this.idPro == null && other.idPro != null) || (this.idPro != null && !this.idPro.equals(other.idPro))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "MODEL.Prospect[ idPro=" + idPro + " ]";
    }
    
}
